package site.taote.sboot.framework.mybatisextends;

import java.util.List;

/**
 * 基础mapper
 *
 * @Author wanghaipeng789
 * @Time 2018/4/23 13:52
 * @Version V1.0
 */
public interface BaseMapper<E> {
    /**
     * 根据id获取entry
     * @param id
     * @return
     */
    public E getById(Long id);

    public List<E> getByIds(List<Integer> ids);

    /**
     * 获取所有的entity
     * @return
     */
    public List<E> getAll();

    public List<E> getAllByEntity(E entity);

    public Page<E> getAllByPage(PageRequest<E> page);

    /**
     * 获取行
     * @return
     */
    public int getCount();

    public int getCountByPage(E entity);

    /**
     * 根据pk删除entity
     * @param id
     * @return
     */
    public int delete(Long id);

    public int insert(E entity);


    public int update(E entity);

    public int merge(E entity);

    public boolean isUnique(E entity, String uniquePropertyNames);

    public void flush();
}
